﻿cmake_minimum_required (VERSION 3.10)
project ("LeetCode")

# 如果支持，请为 MSVC 编译器启用热重载。
if (POLICY CMP0141)
  cmake_policy(SET CMP0141 NEW)
  set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

file(GLOB SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/run ${CMAKE_CURRENT_SOURCE_DIR}/run/*.cpp)
add_executable(main run/${SRC_FILES})
target_include_directories(main PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)

add_executable(sort_functions hub/sort.cpp)

#file(GLOB SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/code ${CMAKE_CURRENT_SOURCE_DIR}/code/*.cpp)
#foreach(FILE ${SRC_FILES})
#	message(${FILE})
#	get_filename_component(EXE ${FILE} NAME_WLE)
#	add_executable(${EXE} code/${FILE})
#  target_include_directories(${EXE} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
#endforeach()
#
#file(GLOB SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/unfinished ${CMAKE_CURRENT_SOURCE_DIR}/unfinished/*.cpp)
#foreach(FILE ${SRC_FILES})
#	message(${FILE})
#	get_filename_component(EXE ${FILE} NAME_WLE)
#	add_executable(0_${EXE} unfinished/${FILE})
#  target_include_directories(0_${EXE} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
#endforeach()